﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using HokjesSluiten;
using System.Drawing;
using System.Collections.Generic;

namespace HokjesSluitenTest
{
    [TestClass]
    public class UnitTest1
    {
        [TestMethod]
        public void TestMaakHokOnder()
        {
            Map map = new Map();

            Streep streep1 = new Streep(
                new Point(0, 0),
                new Point(0, 1));
            map.addStreep(streep1);


            Streep streep2 = new Streep(
                new Point(1, 1),
                new Point(0, 1));
            map.addStreep(streep2);


            Streep streep3 = new Streep(
                new Point(1, 0),
                new Point(1, 1));
            List<Streep> empty = map.addStreep(streep3);

            Assert.AreEqual(0, empty.Count);

            Streep streep4 = new Streep(
                new Point(0, 0),
                new Point(1, 0));
            List<Streep> result = map.addStreep(streep4);

            Assert.AreEqual(1, result.Count);

            Streep streep5 = new Streep(
                new Point(0, 0),
                new Point(1, 0));
            List<Streep> resultNull = map.addStreep(streep5);

            Assert.IsNull(resultNull);
        }

        [TestMethod]
        public void TestMaakHokRechts()
        {
            Map map = new Map();

            Streep streep1 = new Streep(
                new Point(0, 0),
                new Point(1, 0));
            map.addStreep(streep1);


            Streep streep2 = new Streep(
                new Point(1, 0),
                new Point(1, 1));
            map.addStreep(streep2);


            Streep streep3 = new Streep(
                new Point(0, 1),
                new Point(1, 1));
            List<Streep> empty = map.addStreep(streep3);

            Assert.AreEqual(0, empty.Count);

            Streep streep4 = new Streep(
                new Point(0, 0),
                new Point(0, 1));
            List<Streep> result = map.addStreep(streep4);

            Assert.AreEqual(1, result.Count);

            Streep streep5 = new Streep(
                new Point(0, 0),
                new Point(1, 0));
            List<Streep> resultNull = map.addStreep(streep5);

            Assert.IsNull(resultNull);
        }

        [TestMethod]
        public void TestAantalHokjes()
        {
            Map map = new Map(3, 3);
            int aantal = map.hokjesLeft();

            Assert.AreEqual(4, aantal);
        }

        [TestMethod]
        public void TestAantalZetten()
        {
            Map map = new Map(3, 3);
            int aantal = map.movesLeft();

            Assert.AreEqual(24, aantal);
        }
    }
}
